package com.wxy;

import org.junit.jupiter.api.Test;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.StringRedisTemplate;
//import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

import com.wxy.dao.userMapper;
import com.wxy.domain.RedisUser;
import com.wxy.domain.user;

import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@SpringBootTest
public class example {
	@Autowired
	private PasswordEncoder passwordEncoder;
	@Autowired
	private userMapper userMapper;
	@Autowired
	private StringRedisTemplate stringRedisTemplate;
//	@Autowired
//	private PasswordEncoder passwordEncoder;
////	@Test
////	public void test1() {
////		user user=userMapper.findUserByUsername("wang");
////		System.out.println(user);
////	}
//	@Test
//	public void test3() {
//		user user=userMapper.findUserByUsername("张三");
//		System.out.println(user);
//	}
//	@Test
//	public void test2() {
//		System.out.println(passwordEncoder.encode("13579"));
//	}
//	@Test
//	public void test3() {
//		String string=stringRedisTemplate.opsForValue().get("user:1");
//		RedisUser redisUser=JSONUtil.toBean(string,RedisUser.class);
//		user user=redisUser.getUser();
//		log.info(user.toString());
//	}
	@Test
	public void test4() {
		log.info(passwordEncoder.encode("24680"));
	}
}
